package ca.cbc.localsrvextadmin.action;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogoutAction extends LSEAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1266327578167605279L
	;
	private static Logger log = LoggerFactory.getLogger(LogoutAction.class);
	
	public String execute() throws Exception {
		
		try
		{
			Map<String, Object> session = getSession();
			if (session instanceof org.apache.struts2.dispatcher.SessionMap) {
				((org.apache.struts2.dispatcher.SessionMap) session).invalidate();
			}
			return SUCCESS;
		}
		catch( Exception e)
		{
			log.error("  Error in logging out", e);
			throw new Exception("  Error logging out",e);
		}
	}

}
